package com.park.controller;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.park.model.ZtreeShiQuLuDuan;
import com.park.service.Utility;
import com.park.service.ZTreeService;

@Controller
@RequestMapping(value = "/zTree")
public class ZTreeController {
	@Autowired
	private ZTreeService zTreeService;
	
	@RequestMapping(value = "/getTree", method = RequestMethod.POST, produces = {
	"application/json;charset=utf-8" })
	@ResponseBody
	public String getTree(@RequestBody Map<String, Object> args) {
		String userName = (String) args.get("username");
		List<ZtreeShiQuLuDuan> ztrees = zTreeService.getTree(userName);
		return Utility.createJsonMsg(1001, "success",ztrees);
	}

}
